package com.chinabank.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.chinabank.dao.AssignmentDao;
import com.chinabank.dao.DemandReportDao;
import com.chinabank.dao.ReviewDao;
import com.chinabank.model.Account;
import com.chinabank.model.Assignment;
import com.chinabank.model.DemandReport;
import com.chinabank.model.Review;

@Service(value="reviewService")
public class ReviewService {
	private DemandReportDao demandReportDao;
	private AssignmentDao assignmentDao;
	private ReviewDao reviewDao;

	public DemandReportDao getDemandReportDao() {
		return demandReportDao;
	}

	@Resource
	public void setDemandReportDao(DemandReportDao demandReportDao) {
		this.demandReportDao = demandReportDao;
	}

	public AssignmentDao getAssignmentDao() {
		return assignmentDao;
	}

	@Resource
	public void setAssignmentDao(AssignmentDao assignmentDao) {
		this.assignmentDao = assignmentDao;
	}

	public ReviewDao getReviewDao() {
		return reviewDao;
	}

	@Resource
	public void setReviewDao(ReviewDao reviewDao) {
		this.reviewDao = reviewDao;
	}
	
	public void addDemandReport(DemandReport demandReport) {
		demandReportDao.add(demandReport);
	}
	
	public void addAssignment(Assignment assignment) {
		assignmentDao.add(assignment);
	}
	
	public void addReview(Review review) {
		reviewDao.add(review);
	}
	
	public List<DemandReport> getAppliedDemandReports(Account account) {
		return demandReportDao.getAllDemandReportsAsApplier(account);
	}
	public List<DemandReport> getPendingDemandReports(Account account) {
		return demandReportDao.getAllDemandReportsAsReviewer(account);
	}
	
}
